#!/bin/sh
#
# Startup script for dustd
# 
# chkconfig: 345 99 01
# description: 
# processname: 
# config: 

. /lib/lsb/init-functions

PATH=/sbin:/bin:/usr/sbin:/usr/bin
PROG=/home/krdlab/projects/cpp/dustd/dustd
PROGNAME=`basename $PROG`
LOCKFILE=/var/lock/dust
CONFFILE=/etc/dust/dustd.conf
PWD=/home/krdlab/projects/cpp/dustd

[ -f $PROG ] || exit 0

case "$1" in
  start)
    echo -n "Starting $PROGNAME:"
    # TODO start_daemon ?
    $PROG -d --doc-root $PWD --log-file $PWD/dust.log
    echo
    ;;
  stop)
    echo -n "Stopping $PROGNAME:"
    killproc $PROG 9
    echo
    ;;
  status)
    status $PROG
    ;;
  restart)
    $0 stop
    $0 start
    ;;
  *)
    echo "Usage: $PROGNAME {start|stop|status|restart}" >&2
    exit 1
    ;;
esac
exit 0

